package com.crazymo.messenger.aidl;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

import com.crazymo.messenger.IMyMessenger;

/******************************************************************
 * @Copyright : (C), 2001-2021, ZHEJIANG DAHUA TECHNOLOGY CO.,LTD
 * @FileName : MyMessengerService
 * @Author : 224967  Crazy.Mo
 * @Date : 2022/2/10 11:41
 * @Description :    
 * @History :
 * <author>  <time>  <version>   <desc>
 * 224967    修改时间    版本号       描述
 ******************************************************************/

public class MyMessengerService  extends Service {

    private static final String TAG="MyMessengerService";
    private MyMessengerBinder mBinder=new MyMessengerBinder();
    @Override
    public IBinder onBind(Intent intent) {
        return mBinder;
    }

    private static class MyMessengerBinder extends IMyMessenger.Stub{

        @Override
        public String send(String aString) throws RemoteException {
            String ret="reply to client"+aString;
            Log.e(TAG,"received str from c="+aString);
            return ret;
        }
    }
}
